﻿ <html xmlns="http://www.w3.org/1999/xhtml">
 <head runat="server">
     <title>自定义提示</title>

     <script type="text/javascript">
         function validateTime() {

             var starttime ="2012-7-31";
             var endtime = "2012-12-30";
             debugger;
             var istart = parseInt(starttime.split("-")[0]) + parseInt(starttime.split("-")[1]) + parseInt(starttime.split("-")[2]);
             var iend = parseInt(endtime.split("-")[0]) + parseInt(endtime.split("-")[1]) + parseInt(endtime.split("-")[2]);
             if (iend < istart) {
                alert("<font color='red'>结束时间不能小于开始时间/font>");
                 return false;
             }
             else {
                 alert("success");
                 return true;
             }
         }
     </script>
 </head>
 <body onload=" validateTime()">
     <form id="form1" runat="server">



     </form>
 </body>
 </html>
